/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package redis.client;

import org.apache.log4j.Logger;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPubSub;

/**
 *
 * @author chieu
 */
public class PubSubService {

    private static final Logger logger = Logger.getLogger(PubSubService.class);
    private static final Jedis jedis;

    static{
        jedis = new Jedis(REDIS_CONF.HOST,REDIS_CONF.PORT);
        jedis.select(REDIS_CONF.WEBSERVICE_DB);
    }

    
    public static long publish(String chanel, String message) {
        return jedis.publish(chanel, message);
    }

    public static void subscribe(JedisPubSub jedisPubSubImpl, String... chanel) {
        jedis.subscribe(jedisPubSubImpl, chanel);
    }
}
